package com.sora.sora.common.utils;

import com.sora.sora.common.constant.ResultCode;
import com.sora.sora.common.model.vo.ResultVO;
import org.springframework.stereotype.Component;

@Component
public class ResponseResult {

    public ResultVO ok() {
        return new ResultVO(ResultCode.OK, null);
    }

    public ResultVO ok(Object data) {
        return new ResultVO(ResultCode.CREATED, data);
    }

    public ResultVO faile() {
        return new ResultVO(ResultCode.FAILED, null);
    }

    public ResultVO faile(Object data) {
        return new ResultVO(ResultCode.FAILED, data);
    }

    public ResultVO valid() {return new ResultVO(ResultCode.VALIDATE_FAILED, null);}

    public ResultVO valid(Object data) {return new ResultVO(ResultCode.VALIDATE_FAILED, data);}
}
